package com.example.springboot.mapper;

import com.example.springboot.controller.dto.LoginDTO;
import com.example.springboot.controller.request.BaseRequest;
import com.example.springboot.controller.request.LoginRequest;
import com.example.springboot.controller.request.PasswordRequest;
import com.example.springboot.entity.Admin;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author:Domen
 * @Date:2023/11/8 15:26
 */

@Mapper
public interface AdminMapper {

//    @Select("select * from user")
    List<Admin> list();

    List<Admin> listByCondition(BaseRequest baseRequest);

    void save(Admin admin);

    Admin getById(Integer id);

    void updateById(Admin admin);

    void deleteById(Integer id);


    Admin getByUsernameAndPassword(@Param("username") String username, @Param("password") String password);


    int updatePass(PasswordRequest request);

    Admin getByUsername(String username);
}
